package com.icoolkj.ms.system.controller;

import com.icoolkj.ms.api.system.vo.SysConfigVO;
import com.icoolkj.ms.common.core.response.ServerResponseEntity;
import com.icoolkj.ms.common.security.annotation.RequiresPermissions;
import com.icoolkj.ms.system.model.SysConfig;
import com.icoolkj.ms.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author icoolkj
 * @version 1.0
 * @description 系统参数配置表
 * @createDate 2025/02/02 16:10
 */
@RestController
@RequestMapping("/system/config")
public class SysConfigController {

    @Autowired
    private ISysConfigService iSysConfigService;

    @RequiresPermissions("system:area:list")
    @GetMapping("/list")
    public ServerResponseEntity<List<SysConfigVO>> listSysConfig() {
        SysConfig sysConfig = new SysConfig();
        List<SysConfigVO> sysConfigs = iSysConfigService.selectConfigList(sysConfig);
        return ServerResponseEntity.success(sysConfigs);
    }


}
